<div class="row">
	<div class="col-lg-12">
		<h1 class="site-h1" style="background-color:#FFFFFF;">
			案例列表<#if microcaseList??>（${microcaseList.totalElements!''}）</#if>
			<span style="float:right;">
				<button class="layui-btn layui-btn-small green" href="/admin/microcase/add.html" data-toggle="ajax"  data-href-index="/admin/microcase/index" data-width="80%" data-height="95%" data-title="新建案例">
					新建案例
				</button>
			</span>
		</h1>
		<div class="row" style="padding:5px;">
			<div class="col-lg-12">
			    <form class="layui-form uk-form search-form" action="/admin/microcase/index.html">
			    	<div class="form-search">
			            <label class="layui-form-label">标题</label>
			            <div class="layui-input-inline">
			            	<input type="text" name="title" id="title" class="layui-input" placeholder="请输入标题" value="${microcaseH.title!''}">
			            </div>
			        </div>
			        <div class="form-search">
			            <label class="layui-form-label">发布时间</label>
			            <div class="layui-input-inline">
			            	<input type="text" class="layui-input" name="releasetimes" id="releasetimes" value="${microcaseH.releasetimes!''}">
			            </div>
			        </div>
			        <div class="form-search">
			            <label class="layui-form-label">等级</label>
			            <div class="layui-input-inline">
			            	<select name="gradedescribe" id="gradedescribe" placeholder="请选择案例等级">
			                	<option value="">请选择案例等级</option>
								<#if dictgread?? && dictgread??>
								<#list dictgread as dic>
									<option value="${dic.id!''}" <#if microcaseH.gradedescribe == dic.id>selected</#if>>${dic.label!''}</option>
								</#list>
								</#if>
							</select>
			            </div>
			        </div>
					<div class="form-search">
			            <label class="layui-form-label">收费</label>
			            <div class="layui-input-inline">
			            	<select name="charge" id="charge" placeholder="请选择案例等级">
			                	<option value="">请选择</option>
								<option value="0" <#if microcaseH.charge == "0">selected</#if>>收费</option>
			                	<option value="1" <#if microcaseH.charge == "1">selected</#if>>免费</option>
							</select>
			            </div>
			        </div>
			        <div class="form-search">
			           <div class="layui-input-inline">
					      <button class="layui-btn layui-btn-small" lay-submit lay-filter="formDemo">查询</button>
					    </div>
			        </div>
				</form>
				<table class="layui-table" lay-skin="line" id="example-basic">
				  <thead>
					<tr>
					  <th>标题</th>
					  <th>价格</th>
					  <th>案例等级</th>
					  <th>角色</th>
					  <th>发布人</th>
					  <th>下载量</th>
					  <th>评价量</th>
					  <th>发布时间</th>
					  <th>状态</th>
					  <th style="white-space:nowrap;" nowrap="nowrap">操作</th>
					</tr> 
				  </thead>
				  <tbody>
					<#if microcaseList?? && microcaseList??>
					<#list microcaseList.content as microcase>
					<tr>
					  <td class="add">${microcase.title!''}</td>
					  <td>
					  	<#if microcase.price?? && microcase.price?string('')=='0'>
							<span>免费</span>
						<#else>
							<span class="layui-elip red">￥&nbsp;${microcase.price?string('0.00')}</span>
						</#if>
					  </td>
					  <td>${microcase.gradename!''}</td>
					  <td>
						  <#if microcase.rolename?? && microcase.rolename == '0'>
						  	  <span>管理员</span>
						  <#else>
							  <span>普通用户</span>
						  </#if>
					  </td>
					  <td>${microcase.author!''}</td>
					  <td>
				  		<a href="/admin/microcase/downList.html?id=${microcase.id!''}" data-toggle="ajax"   data-href-index="/admin/microcase/index" data-width="80%" data-height="95%" data-title="下载量">
				  			${microcase.downnums!''}
				  		</a>
					  </td>
					  <td>
					  	<a href="/admin/microcase/commentList.html?id=${microcase.id!''}" data-toggle="ajax"   data-href-index="/admin/microcase/index" data-width="80%" data-height="95%" data-title="评论信息">
					  		${microcase.commentnums!''}
					  	</a>
					  </td>
					  <td>${microcase.releasetime!?string("yyyy-MM-dd")}</td>
					  <td>
					  	  <#if microcase.auditstatus?? && microcase.auditstatus == '0'>
						  	  <span>待审核</span>
						  <#elseif microcase.auditstatus?? && microcase.auditstatus == '1'>
							  <span>审核通过</span>
						  <#elseif microcase.auditstatus?? && microcase.auditstatus == '2'>
						  	  <span>审核未通过</span>
						  <#else>
						  	  <span>/</span>
						  </#if>
					  </td>
					  <td style="white-space:nowrap;" nowrap="nowrap">		
					  		<a href="/admin/microcase/edit.html?id=${microcase.id!''}" data-toggle="ajax"   data-href-index="/admin/microcase/index" data-width="80%" data-height="95%" data-title="编辑信息">
					  			<i class="layui-icon">&#xe642;</i>
					  			编辑
					  		</a>
					  		<a href="/admin/microcase/delete.html?id=${microcase.id!''}" style="margin-left:10px;" data-toggle="tip" data-title="请确认是否删除记录？">
					  			<i class="layui-icon" style="color:red;">&#x1006;</i>
					  			删除
					  		</a>
					  		<#if microcase.official?? && microcase.official == '1'&&  microcase.auditstatus?? && microcase.auditstatus == '0'>
								<a href="/admin/microcase/audits.html?id=${microcase.id!''}" style="margin-left:10px;" data-toggle="ajax"  data-href-index="/admin/microcase/index" data-width="80%" data-height="95%" data-title="审核信息">
						  			<i class="layui-icon">&#xe639;</i>
						  			审核
						  		</a>
							</#if>
					  </td>
					</tr>
					</#list>
					</#if>
				  </tbody>
				</table>
			</div> 	   
		</div>
		<div class="row" style="padding:5px;">
			<div class="col-lg-12" id="page" style="text-align:center;"></div>
		</div>
	</div>	
</div>
<script>
var list= [];
<#list microcaseList.content as list>
	list.push({"id":"${list.id!''}","price":"${list.price!''}"});
</#list>
console.log(list);
	layui.use(['laypage', 'layer','form','laydate'], function(){
	  var laypage = layui.laypage
	  ,layer = layui.layer;
	  laypage({
			cont: 'page'
			,pages: <#if microcaseList??>${microcaseList.totalPages}<#else>0</#if> //总页数
			,curr:<#if microcaseList??>${microcaseList.number+1}<#else>0</#if>
			,groups: 5 //连续显示分页数
			,jump:function(data , first){
				if(!first){
					location.href = "/admin/microcase/list.html?p="+data.curr ;
				}
			}
	   });
	    var start = {
	       istoday: true
	       ,choose: function(dates){ //选择好日期的回调
	     	  $("#releasetimes").val(dates);
	       }
	    };
	    
	    $("#releasetimes").click(function(){
	    	start.elem = this;
	        laydate(start);
	    });
	});
</script>